package DP_119;

import java.util.LinkedList;
import java.util.List;

public class Solution {
	public List<Integer> getRow(int rowIndex) {
		int[] dp = new int[rowIndex + 1];

		for (int i = 0; i <= rowIndex; i++) {
			dp[i] = 1;
			for (int j = i; j > 1; j--) {
				dp[j-1] = dp[j - 2] + dp[j - 1];
			}
		}

		List<Integer> res = new LinkedList<Integer>();
		for (int i = 0; i < dp.length; i++) {
			res.add(dp[i]);
		}
		return res;

	}
}
